package learn;

public class five {
    public static void main(String[] args) {
        boolean isGreater = 5 > 3; // true
        int age = 12;
        boolean isZero = age == 0; // false
        boolean isNonZero = !isZero; // true
        boolean isAdult = age >= 18; // false
        boolean isTeenager = age >6 && age <18; // true

        boolean b = 5 < 3;
        boolean result = b && (5 / 0 > 0);
        System.out.println(result);


        ///三元运算符
        int n = -100;
        int x = n >= 0 ? n : -n; //判断n >= 0是否成立，如果为true，则返回n，否则返回-n。这实际上是一个求绝对值的表达式。
        System.out.println(x);

        int age2 = 7;
        // primary student的定义: 6~12岁
        boolean isPrimaryStudent = (age2>=6 || age2<=12);
        System.out.println(isPrimaryStudent ? "Yes" : "No");


    }

}
